package com.example.qxfw.qxxx.service.impl;

import com.example.qxfw.common.entity.qx.*;
import com.example.qxfw.qxxx.mapper.SumDateCommonMapper;
import com.example.qxfw.qxxx.service.SumDataCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SumDataCommonServiceImpl implements SumDataCommonService {

    @Autowired
    private SumDateCommonMapper sumDateCommonMapper;

    @Override
    public List<SumRainHouData> getHouData(String type, String tableName, String cn, String start, String end) {
        return sumDateCommonMapper.selectHouData(type, tableName, cn, start, end);
    }

    @Override
    public List<SumRainTdData> getXunData(String type, String tableName, String cn, String start, String end) {
        return sumDateCommonMapper.selectXunData(type, tableName, cn, start, end);
    }

    @Override
    public List<SumRainMonthData> getMonthData(String type, String tableName, String cn, String start, String end) {
        return sumDateCommonMapper.selectMonthData(type, tableName, cn, start, end);
    }

    @Override
    public List<SumRainYearData> getYearData(String type,String tableName, String cn, String start, String end) {
        return sumDateCommonMapper.selectYearData(type, tableName, cn, start, end);
    }

    @Override
    public Integer deleteDayData(String tableName, String year, String month, String day, String stationId) {
        return sumDateCommonMapper.deleteDayData(tableName, year, month, day, stationId);
    }

    @Override
    public Integer saveDayData(String tableName, SumRainDayData sumRainDayData) {
        return sumDateCommonMapper.insertDayData(tableName, sumRainDayData);
    }

    @Override
    public Integer deleteHouData(String tableName, String year, String month, String hou, String stationId) {
        return sumDateCommonMapper.deleteHouData(tableName, year, month, hou, stationId);
    }

    @Override
    public Integer saveHouData(String tableName, SumRainHouData sumRainHouData) {
        return sumDateCommonMapper.insertHouData(tableName, sumRainHouData);
    }

    @Override
    public Integer deleteXunData(String tableName, String year, String month, String td, String stationId) {
        return sumDateCommonMapper.deleteXunData(tableName, year, month, td, stationId);
    }

    @Override
    public Integer saveXunData(String tableName, SumRainTdData sumRainTdData) {
        return sumDateCommonMapper.insertXunData(tableName, sumRainTdData);
    }

    @Override
    public Integer deleteMonthData(String tableName, String year, String month, String stationId) {
        return sumDateCommonMapper.deleteMonthData(tableName, year, month, stationId);
    }

    @Override
    public Integer saveMonthData(String tableName, SumRainMonthData sumRainMonthData) {
        return sumDateCommonMapper.insertMonthData(tableName, sumRainMonthData);
    }

    @Override
    public Integer deleteYearData(String tableName, String year, String stationId) {
        return sumDateCommonMapper.deleteYearData(tableName, year, stationId);
    }

    @Override
    public Integer saveYearData(String tableName, SumRainYearData sumRainYearData) {
        return sumDateCommonMapper.insertYearData(tableName, sumRainYearData);
    }

    @Override
    public List<SumRainYearData> getYearAvg(String tableName, String name, String y1, String y2, String stationName) {
        return sumDateCommonMapper.selectYearAvg(tableName, name, y1, y2, stationName);
    }

    @Override
    public List<SumRainYearData> getYear1(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectYear(tableName, sumindicatorname, stationname, y1, y2);
    }

    @Override
    public List<SumRainYearData> getYear2(String tableName, String sumindicatorname, String stationname) {
        return sumDateCommonMapper.selectYear1(tableName, sumindicatorname, stationname);
    }

    @Override
    public List<SumRainYearData> getYear3Month(String tableName, String sumindicatorname, String stationname, String y1, String y2, String m1, String m2) {
        return sumDateCommonMapper.selectYear3Month(tableName, sumindicatorname, stationname, y1, y2, m1, m2);
    }

    @Override
    public List<SumRainYearData> getYearMonth(String tableName, String sumindicatorname, String stationname, String y1, String y2, String m) {
        return sumDateCommonMapper.selectYearMonth(tableName, sumindicatorname, stationname, y1, y2, m);
    }

    @Override
    public List<SumRainYearData> getYearTd(String tableName, String sumindicatorname, String stationname, String y1, String y2, String m, String tdhou) {
        return sumDateCommonMapper.selectYearTd(tableName, sumindicatorname, stationname, y1, y2, m, tdhou);
    }

    @Override
    public List<SumRainYearData> getYearHou(String tableName, String sumindicatorname, String stationname, String y1, String y2, String m, String tdhou) {
        return sumDateCommonMapper.selectYearHou(tableName, sumindicatorname, stationname, y1, y2, m, tdhou);
    }

    @Override
    public List<SumRainMonthData> getMonthAvg(String tableName, String sumindicatorname, String y1, String y2, String stationname) {
        return sumDateCommonMapper.selectMonthAvgData(tableName, sumindicatorname, y1, y2, stationname);
    }

    @Override
    public List<SumRainMonthData> getMonth(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectMonth(tableName, sumindicatorname, stationname, y1, y2);
    }


    @Override
    public List<SumRainDayData> getDay(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectDay(tableName, sumindicatorname, stationname, y1, y2);
    }

    @Override
    public List<SumRainDayData> getDayCount(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectDayCount(tableName, sumindicatorname, stationname, y1, y2);
    }



    @Override
    public List<SumRainTdData> getXunAvg(String tableName, String sumindicatorname, String y1, String y2, String stationname) {
        return sumDateCommonMapper.selectXunAvg(tableName, sumindicatorname, y1, y2, stationname);
    }

    @Override
    public List<SumRainTdData> getXun(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectXun(tableName, sumindicatorname, stationname, y1, y2);
    }

    @Override
    public List<SumRainHouData> getHouAvg(String tableName, String sumindicatorname, String y1, String y2, String stationname) {
        return sumDateCommonMapper.selectHouAvg(tableName, sumindicatorname, y1, y2, stationname);
    }

    @Override
    public List<SumRainHouData> getHou(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectHou(tableName, sumindicatorname, stationname, y1, y2);
    }

    @Override
    public List<SumRainDayData> getXunDay(String tableName, String sumindicatorname, String stationname, String y1, String y2) {
        return sumDateCommonMapper.selectXunDay(tableName, sumindicatorname, stationname, y1, y2);
    }

    @Override
    public List<SumRainMonthData> getHighWater(String year, String months) {
        return sumDateCommonMapper.selectHighWater(year,months);
    }

    @Override
    public List<SumRainMonthData> getHighWaterXqBefore(String satrt,String end) {
        return sumDateCommonMapper.selectHighWaterBefore(satrt,end);
    }
    @Override
    public List<SumRainMonthData> getHighWaterXqAfter(String satrt,String end) {
        return sumDateCommonMapper.selectHighWaterAfter(satrt,end);
    }
    @Override
    public List<SumRainMonthData> getHighWaterXq(String satrt,String end) {
        return sumDateCommonMapper.selectHighWaterXq(satrt,end);
    }

    @Override
    public List<SumRainMonthData> getHighWaterXqAvg(String start, String end) {
        return sumDateCommonMapper.selectHighWaterXqAvg(start, end);
    }

    @Override
    public List<SumRainYearData> getYearDay(String optype, String tableName, String elementName, String stationName, String y1, String y2, String m1, String m2, String d1, String d2) {
        return sumDateCommonMapper.selectYearDay(optype, tableName, elementName, stationName, y1, y2, m1, m2, d1, d2);
    }

    @Override
    public List<SumRainDayData> getDayData1(String optype, String tableName, String elementName, String stationName, String start, String end) {
        return sumDateCommonMapper.getDayData1(optype, tableName, elementName, stationName, start, end);
    }

    @Override
    public List<SumRainDayData> getDayData2(String optype, String tableName, String elementName, String stationName, String start, String end) {
        return sumDateCommonMapper.getDayData2(optype, tableName, elementName, stationName, start, end);
    }

    @Override
    public List<SumRainMonthData> getHighWaterAvg(String year) {
        return sumDateCommonMapper.selectHighWaterAvg(year);
    }
}
